Class PrivilegeManagerImpl

All Implemented Interfaces:
IPCObject, PrivilegeManager, Process

public class PrivilegeManagerImpl extends ProcessImpl implements PrivilegeManager
Information provided by the PKI file:

    \class PrivilegeManager
    
    \brief PrivilegeManager handles and manipulates privileges on routers and switches.
    
    \example network().getDevice("Router0").getProcess("PrivilegeManager")
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • addCommand

      public boolean addCommand(String mode, String command, boolean bAll, int level)
      Information provided by the PKI file:
      
          \brief Adds the specified command to the specified mode at the specified privilege level.
          
          \param mode, the mode to add the command to. Valid modes: user, enable, global.
          \param command, the command of interest.
          \param bAll, true to include all, false to not include all.
          \param level, the privilege level.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      addCommand in interface PrivilegeManager
      Parameters:
      mode - Takes in a parameter of mode
      command - Takes in a parameter of command
      bAll - Takes in a parameter of bAll
      level - Takes in a parameter of level
      Returns:
      boolean Returns a boolean
    • removeCommand

      public boolean removeCommand(String mode, String command)
      Information provided by the PKI file:
      
          \brief Removes the specified command from the specified mode.
          
          \param mode, the mode to add the command to. Valid modes: user, enable, global.
          \param command, the command of interest.
          
          \return bool, true if successful, otherwise false.
          
              
      Specified by:
      removeCommand in interface PrivilegeManager
      Parameters:
      mode - Takes in a parameter of mode
      command - Takes in a parameter of command
      Returns:
      boolean Returns a boolean
    • getModeCount

      public int getModeCount()
      Information provided by the PKI file:
      
          \brief Returns the number of modes.
          
          \return int, the number of modes.
          
              
      Specified by:
      getModeCount in interface PrivilegeManager
      Returns:
      int Returns a int
    • getModeAt

      public String getModeAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the mode at the specified index.
          
          \param index, the index of the mode of interest.
          
          \return string, the mode at the specified index.
          
              
      Specified by:
      getModeAt in interface PrivilegeManager
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • getCommandForModeCount

      public int getCommandForModeCount(String mode)
      Information provided by the PKI file:
      
          \brief Returns the number of commands for the specified mode.
          
          \param mode, the mode of interest. Valid modes: user, enable, global.
          
          \return int, the number of commands for the specified mode.
          
              
      Specified by:
      getCommandForModeCount in interface PrivilegeManager
      Parameters:
      mode - Takes in a parameter of mode
      Returns:
      int Returns a int
    • getCommandForModeAt

      public Pair<String,CommandPrivilege> getCommandForModeAt(String mode, int index)
      Information provided by the PKI file:
      
          \brief Returns the command string and CommandPrivilege object in the specified mode at the specified index.
          
          \param mode, the mode of interest. Valid modes: user, enable, global.
          \param index, the index of the command of interest.
          
          \return pair<string, CommandPrivilege@"CommandSet::SCommandPrivilege">, the command and CommandPrivilege object.
          
              
      Specified by:
      getCommandForModeAt in interface PrivilegeManager
      Parameters:
      mode - Takes in a parameter of mode
      index - Takes in a parameter of index
      Returns:
      Pair<String, CommandPrivilege> Returns a Pair<String, CommandPrivilege>
    • getCommandForMode

      public Pair<String,CommandPrivilege> getCommandForMode(String mode, String command)
      Information provided by the PKI file:
      
          \brief Returns the command string and CommandPrivilege object in the specified mode for the specified command.
          
          \param mode, the mode of interest. Valid modes: user, enable, global.
          \param command, the command of interest.
          
          \return pair<string, CommandPrivilege@"CommandSet::SCommandPrivilege">, the command and CommandPrivilege object.
          
              
      Specified by:
      getCommandForMode in interface PrivilegeManager
      Parameters:
      mode - Takes in a parameter of mode
      command - Takes in a parameter of command
      Returns:
      Pair<String, CommandPrivilege> Returns a Pair<String, CommandPrivilege>
    • isCommandAdded

      public boolean isCommandAdded(String commandStr)
      Information provided by the PKI file:
      
          \brief Returns true if the command is already added, otherwise false.
          
          \param commandStr, command string to check for.
          
          \return bool, true if the command is already added, otherwise false.
          
              
      Specified by:
      isCommandAdded in interface PrivilegeManager
      Parameters:
      commandStr - Takes in a parameter of commandStr
      Returns:
      boolean Returns a boolean